#ifndef HASIO_DETAIL_OP_QUEUE_HPP
#define HASIO_DETAIL_OP_QUEUE_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <queue>

template<typename Operation>
class op_queue
{
public:

    ~op_queue()
    {
        while (Operation* op = queue_.front())
        {
            queue_.pop();
            delete op;
        }
    }

    bool empty() const
    {
        return queue_.empty();
    }

    Operation* front()
    {
        return queue_.front();
    }

    void push(Operation* op)
    {
        queue_.push(op);
    }

    template<typename OtherOperation>
    void push(op_queue<OtherOperation> &other)
    {
    }
    
    void pop()
    {
        if (queue_.empty())
        {
            return;
        }
        queue_.pop();
    }
private:
    std::queue<Operation*> queue_;
    //Operation* next_;
};

#endif // HASIO_DETAIL_OP_QUEUE_HPP